﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="branchknowledge.aspx.cs" Inherits="WebApplication1.admin.branchknowledge" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:theknowledgebaseConnectionString %>" 
        DeleteCommand="DELETE FROM [domain] WHERE [id_domain] = @original_id_domain AND (([domain] = @original_domain) OR ([domain] IS NULL AND @original_domain IS NULL))" 
        InsertCommand="INSERT INTO [domain] ([id_domain], [domain]) VALUES (@id_domain, @domain)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT [id_domain], [domain] FROM [domain]" 
        UpdateCommand="UPDATE [domain] SET [domain] = @domain WHERE [id_domain] = @original_id_domain AND (([domain] = @original_domain) OR ([domain] IS NULL AND @original_domain IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_id_domain" Type="Int32" />
            <asp:Parameter Name="original_domain" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="id_domain" Type="Int32" />
            <asp:Parameter Name="domain" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="domain" Type="String" />
            <asp:Parameter Name="original_id_domain" Type="Int32" />
            <asp:Parameter Name="original_domain" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:theknowledgebaseConnectionString %>" 
        DeleteCommand="DELETE FROM [domain] WHERE [id_domain] = @original_id_domain AND (([domain] = @original_domain) OR ([domain] IS NULL AND @original_domain IS NULL))" 
        InsertCommand="INSERT INTO [domain] ([id_domain], [domain]) VALUES (@id_domain, @domain)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT [id_domain], [domain] FROM [domain] WHERE ([id_domain] = @id_domain)" 
        UpdateCommand="UPDATE [domain] SET [domain] = @domain WHERE [id_domain] = @original_id_domain AND (([domain] = @original_domain) OR ([domain] IS NULL AND @original_domain IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_id_domain" Type="Int32" />
            <asp:Parameter Name="original_domain" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="id_domain" Type="Int32" />
            <asp:Parameter Name="domain" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="id_domain" 
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="domain" Type="String" />
            <asp:Parameter Name="original_id_domain" Type="Int32" />
            <asp:Parameter Name="original_domain" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataKeyNames="id_domain" DataSourceID="SqlDataSource2" 
        ForeColor="#333333" GridLines="None" Height="50px" Width="906px" 
        onitemdeleted="DetailsView1_ItemDeleted" 
        oniteminserted="DetailsView1_ItemInserted" 
        onitemupdated="DetailsView1_ItemUpdated">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="id_domain" HeaderText="ID отрасли знаний" 
                ReadOnly="True" SortExpression="id_domain">
            <ItemStyle Width="700px" />
            </asp:BoundField>
            <asp:BoundField DataField="domain" HeaderText="Отрасль знаний" 
                SortExpression="domain">
            <ItemStyle Width="700px" />
            </asp:BoundField>
            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.png" 
                DeleteImageUrl="~/images/delete.png" EditImageUrl="~/images/Изменить.png" 
                InsertImageUrl="~/images/new.png" NewImageUrl="~/images/new.png" 
                SelectImageUrl="~/images/select.png" ShowDeleteButton="True" 
                ShowEditButton="True" ShowInsertButton="True" 
                UpdateImageUrl="~/images/update.png" />
        </Fields>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    </asp:DetailsView>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataKeyNames="id_domain" DataSourceID="SqlDataSource1" ForeColor="#333333" 
        GridLines="None" Width="911px">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ButtonType="Image" SelectImageUrl="~/images/select.png" 
                ShowSelectButton="True">
            <ItemStyle Width="20px" />
            </asp:CommandField>
            <asp:BoundField DataField="id_domain" HeaderText="ID отрасли знаний" 
                ReadOnly="True" SortExpression="id_domain">
            <ItemStyle Width="20px" />
            </asp:BoundField>
            <asp:BoundField DataField="domain" HeaderText="Отрасль знаний" 
                SortExpression="domain">
            <ItemStyle Width="700px" />
            </asp:BoundField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <br />
</asp:Content>
